package com.heima.comment.controller;

import com.heima.comment.dto.CommentRepayLikeDto;
import com.heima.comment.dto.CommentRepaySaveDto;
import com.heima.comment.service.IApCommentRepayService;
import com.heima.common.dto.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/comment_repay")
public class ApCommentRepayController {


    @Resource
    private IApCommentRepayService repayService;

    /**
     * 评论回复保存
     * @param dto
     * @return
     */
    @PostMapping("/save")
    public ResponseResult save(@RequestBody CommentRepaySaveDto dto) {

        return repayService.save(dto);
    }

    @PostMapping("like")
    public ResponseResult like(@RequestBody CommentRepayLikeDto dto) {

        return repayService.like(dto);
    }
}
